<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
  <title>编辑类目</title>
  <meta charset="utf-8"/>
  <link rel="stylesheet" href="css/bootstrap.css"/>
</head>
<body>
<div class="container-fluid">
  <jsp:include page="/admin/header.jsp"></jsp:include>
  <br>
  <div>
    <form class="form-horizontal" method="post" action="${pageContext.request.contextPath}/admin/type_edit">
      <div class="form-group">
        <label for="input_id" class="col-sm-2 control-label">ID</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="input_id" name="id" value="${type.id}" readonly>
        </div>
      </div>
      <div class="form-group">
        <label for="input_name" class="col-sm-2 control-label">名称</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="input_name" name="name" value="${type.name}" required>
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="submit" class="btn btn-primary">提交</button>
        </div>
      </div>
    </form>
  </div>
  <br/>
  <c:if test="${!empty msg}">
    <div class="alert alert-success">${msg}</div>
  </c:if>
  <c:if test="${!empty failMsg}">
    <div class="alert alert-danger">${failMsg}</div>
  </c:if>
  <br>
  <div>
    <a href="${pageContext.request.contextPath}/admin/type_list" class="btn btn-default">返回类目列表</a>
  </div>
</div>
</body>
</html>